package com.ss.jdk.lambda;

import com.ss.jdk.lambda.service.OrderService;
import com.ss.jdk.lambda.service.StudentService;
import com.sun.org.apache.bcel.internal.generic.RETURN;
import com.sun.org.apache.regexp.internal.RE;
import sun.java2d.pipe.SpanIterator;

import javax.naming.Name;

/**
 * @Auther: ljy.s
 * @Date: 2022/9/10 - 09 - 10 - 10:09
 */
public class Demo05Lambda {

    public static void main(String[] args) {
        goStudent((String name, Integer age) -> {
            System.out.println(name + age + "ss i miss you...");
            return name + age + "ss i miss you...";
        });

        // 省略写法
        goStudent((name, age) -> name + age + "ss i miss you..." );

        System.out.println("========================================");

        goOrder((String name) -> {
            System.out.println("--->" + name);
            return 33;
        });

        // 省略写法
        goOrder(name -> 33);
    }

    public static void goStudent(StudentService studentService) {
        studentService.show("张三", 22);
    }

    public static void goOrder(OrderService orderService) {
        orderService.show("李四");
    }
}
